import {Message} from 'element-ui'
import {fetchMultipleDeletes} from '../api/index'
export function handlerFeatchData(data){
  if(data.code != 200 )return Message.error('获取数据失败')
  else{
    Message.success(data.msg)
    return data.data
  }
}

export function deletemultiple (url,ids){
  if(!ids.length){
    Message.error('请选择删除一至多项')
  }
  ids.forEach((item)=>{
    fetchMultipleDeletes(url,item).then(res=>{
      Message.success('删除成功')
    })

  })
}

// export const pagingMethods = {
//   paging: {
//     size: 1,
//     yetiao: 2,
//     total: 0,
//     totalPage: 0,
//   },
//   handleSizeChange(val) {
//     this.paging.yetiao = val
//     this.showShopsTable = this.shopsTable.slice(0, val)
//   },
//   handleCurrentChange(currentRow) {
//     this.paging.size = currentRow
//     this.showShopsTable = this.shopsTable.slice(currentRow * this.paging.yetiao - this.paging.yetiao, currentRow * this.paging.yetiao)
//   },
// }